package com.haierp.enums;

/**
 * @author 朱路
 */
public enum PlatformType {
	YOUZAN(1, "有赞"),
	WEIXIN(2, "微信"),
	WEIXINXCX(3, "微信小程序"),
	HAIHU(4, "海狐"),
	XIAOHONGSHU(5, "小红书"),
	XIAOHONGSHUBAG(6, "小红书箱包店"),
    YITAO(6, "一桃平台"),
	OTHER(10, "其他");
    private int code;
    private String description;

    PlatformType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
    
    public static PlatformType of(int code) {
        for (PlatformType status : PlatformType.values()) {
            if (status.code == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("invalid status code " + code);
    }
	
}
